<?php

namespace App\Http\Controllers\Api;

use App\Http\Resources\IndustryCollection;
use App\model\Industry;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class IndustryController extends Controller
{
    public function index(Request $request){
        $project_id=$request->input('project_id',null);
        if ($project_id){
            $industry=Industry::where('project_id',$project_id)->get();

        }else{
            $industry=Industry::all();
        }

        return new IndustryCollection($industry);
    }
}
